#ifndef DAHENG5000CAMERA_H
#define DAHENG5000CAMERA_H

#include <QMessageBox>
#include "GxIAPI.h"
#include "DxImageProc.h"
#include "GXBitmap.h"
#include "camera.h"

class Daheng5000Camera : public Camera
{
public:
    Daheng5000Camera();
    Daheng5000Camera(QWidget* pWidget = nullptr,QString ip = nullptr);
    ~Daheng5000Camera();

private:
    QWidget*        m_pWidget;
    QString         m_strIP;

public:
    QWidget*        GetWidget(){return m_pWidget;}

private:
    GX_STATUS       emStatus ;
    GX_DEV_HANDLE   m_hDevice;
    GX_DS_HANDLE    m_hStream;
    GX_OPEN_PARAM   stOpenParam;
    uint32_t        m_ui32DeviceNum;
    HWND            m_hWidgetCamera;
    //定义掉线回调函数句柄
    GX_EVENT_CALLBACK_HANDLE m_hDevcieOfflineCallBack;
    QString         m_strTriggerMode;

public:
    virtual int InitDevice(QString triggerMode) override;
    virtual int OnClose() override;
    virtual int OpenDevice() override;
    virtual int ConfigCaptureVideo() override;
    virtual int UnconfigCaptureVideo() override;
    virtual int StopSnap() override;
    virtual int CloseDevice() override;
    virtual int StartSnap() override;
    virtual int TriggerSoftware() override;
    virtual int CaptureVideo() override;
    virtual int ClearWidget() override;

    virtual QString GetIP() override;
    virtual int SaveBmp(const char* pFilePath) override;
    virtual int SaveJpeg(const char* pFilePath) override;

    GX_DEV_HANDLE   GetDeviceHandle(){return m_hDevice;}

    int CaptureImage();

public:
    CGXBitmap       *m_pBitmap;
};

#endif // DAHENG5000CAMERA_H
